//2、编写程序，对输入的年、月、日，给出该天是该年的第多少天？
//例如：2022年1月15日，是该年的第15天

import java.util.Scanner;


public class Text2 {
    public static void main(String[] args) {
       int year=5,month=0,day=0;
       int count=0;
        System.out.println("请输入**年**月**日");
        Scanner sc=new Scanner(System.in);
        year=sc.nextInt();
        month=sc.nextInt();
        day= sc.nextInt();
        count=day;
        if(is_gapyear(year)){
            switch (month){
                case 1:
                    day=day;
                    break;
                case 2:
                    day+=31;
                    break;
                case 3:
                    day+=60;
                    break;
                case 4:
                    day+=91;
                    break;
                case 5:
                    day+=121;
                    break;
                case 6:
                    day+=152;
                    break;
                case 7:
                    day+=182;
                    break;
                case 8:
                    day+=213;
                    break;
                case 9:
                    day+=244;
                    break;
                case 10:
                    day+=274;
                    break;
                case 11:
                    day+=305;
                    break;
                case 12:
                    day+=335;
                    break;

            }
        }else {
            switch (month) {
                case 1:
                    day = day;
                    break;
                case 2:
                    day += 31;
                    break;
                case 3:
                    day += 59;
                    break;
                case 4:
                    day += 90;
                    break;
                case 5:
                    day += 120;
                    break;
                case 6:
                    day += 151;
                    break;
                case 7:
                    day += 181;
                    break;
                case 8:
                    day += 212;
                    break;
                case 9:
                    day += 243;
                    break;
                case 10:
                    day += 273;
                    break;
                case 11:
                    day += 304;
                    break;
                case 12:
                    day += 334;
                    break;
            }
        }
        System.out.println(year+"年"+month+"月"+count+"日，是该年的第"+day+"日");

    }
    public static boolean is_gapyear(int year){

        if(year%4==0&&year%100!=0||year%400==0){
           return true;
        }
       return false;
    }
}
